//
//  LotteryCellModel.m
//  BCW
//
//  Created by Mac on 16/3/30.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "LotteryCellModel.h"
#import "NSString+Unicode.h"

@implementation LotteryCellModel

- (instancetype)initWithArr:(NSArray *)dataArr{
    if (self) {
        for (int j = 0; j < dataArr.count; j ++) {
            
            if (j < 5) {
                if (j == 0) {
                    self.number = dataArr[j];
                }
                else{
                    self.number = [NSString stringWithFormat:@"%@,%@", self.number, dataArr[j]];
                }
                
            }
            else{
                if (j == 5) {
                    self.danShuang = dataArr[j];
                }
                else{
                    self.bigOrSmall = dataArr[j];
                }
                
            }
        }

    }
    
    return self;
}

- (instancetype)initWithDataStr:(NSString *)str{
    
    if (self) {
        NSArray *temp = [str componentsSeparatedByString:@",\""];
        if (temp.count < 3) {
            return self;
        }
        
        self.number = temp[0];
        
        
        
        self.danShuang = [NSString replaceUnicode:[temp[1] substringToIndex:[temp[1] length] - 1]];
        
        
        self.bigOrSmall = [NSString replaceUnicode:[temp[2] substringToIndex:[temp[2] length] - 1]];
    }
    return self;
}

@end
